﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: Tuesday, July 12, 2011 11:08:19 AM
// Code is generated using templates: SD.TemplateBindings.SqlServerSpecific.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Data;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace DatabaseAdapter
{
	/// <summary>
	/// Singleton implementation of the PersistenceInfoProvider. This class is the singleton wrapper through which the actual instance is retrieved.
	/// </summary>
	/// <remarks>It uses a single instance of an internal class. The access isn't marked with locks as the PersistenceInfoProviderBase class is threadsafe.</remarks>
	internal sealed class PersistenceInfoProviderSingleton
	{
		#region Class Member Declarations
		private static readonly IPersistenceInfoProvider _providerInstance = new PersistenceInfoProviderCore();
		#endregion
		
		/// <summary>private ctor to prevent instances of this class.</summary>
		private PersistenceInfoProviderSingleton()
		{
		}

		/// <summary>Dummy static constructor to make sure threadsafe initialization is performed.</summary>
		static PersistenceInfoProviderSingleton()
		{
		}

		/// <summary>Gets the singleton instance of the PersistenceInfoProviderCore</summary>
		/// <returns>Instance of the PersistenceInfoProvider.</returns>
		public static IPersistenceInfoProvider GetInstance()
		{
			return _providerInstance;
		}
	}

	/// <summary>Actual implementation of the PersistenceInfoProvider. Used by singleton wrapper.</summary>
	internal class PersistenceInfoProviderCore : PersistenceInfoProviderBase
	{
		/// <summary>Initializes a new instance of the <see cref="PersistenceInfoProviderCore"/> class.</summary>
		internal PersistenceInfoProviderCore()
		{
			Init();
		}

		/// <summary>Method which initializes the internal datastores with the structure of hierarchical types.</summary>
		private void Init()
		{
			base.InitClass((5 + 0));
			InitChungLoaiSanPhamEntityMappings();
			InitLoginLogoutEntityMappings();
			InitSanPhamEntityMappings();
			InitSanPhamKhuonEntityMappings();
            InitSanPhamClastEntityMappings();
            InitSanPhamGotCheEntityMappings();
            InitSanPhamBoEntityMappings();
		}


		/// <summary>Inits ChungLoaiSanPhamEntity's mappings</summary>
		private void InitChungLoaiSanPhamEntityMappings()
		{
			base.AddElementMapping( "ChungLoaiSanPhamEntity", "TKCN", @"dbo", "ChungLoaiSanPham", 2 );
			base.AddElementFieldMapping( "ChungLoaiSanPhamEntity", "MaChungLoaiSanPham", "MaChungLoaiSanPham", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 0 );
			base.AddElementFieldMapping( "ChungLoaiSanPhamEntity", "TenChungLoaiSanPham", "TenChungLoaiSanPham", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 1 );
		}
		/// <summary>Inits LoginLogoutEntity's mappings</summary>
		private void InitLoginLogoutEntityMappings()
		{
			base.AddElementMapping( "LoginLogoutEntity", "TKCN", @"dbo", "LoginLogout", 4 );
			base.AddElementFieldMapping( "LoginLogoutEntity", "Username", "Username", false, (int)SqlDbType.NVarChar, 10, 0, 0, false, "", null, typeof(System.String), 0 );
			base.AddElementFieldMapping( "LoginLogoutEntity", "Fullname", "Fullname", true, (int)SqlDbType.NVarChar, 100, 0, 0, false, "", null, typeof(System.String), 1 );
			base.AddElementFieldMapping( "LoginLogoutEntity", "Password", "Password", true, (int)SqlDbType.NVarChar, 100, 0, 0, false, "", null, typeof(System.String), 2 );
			base.AddElementFieldMapping( "LoginLogoutEntity", "Role", "Role", true, (int)SqlDbType.NVarChar, 10, 0, 0, false, "", null, typeof(System.String), 3 );
		}
		/// <summary>Inits SanPhamEntity's mappings</summary>
		private void InitSanPhamEntityMappings()
		{
			base.AddElementMapping( "SanPhamEntity", "TKCN", @"dbo", "SanPhamNew", 11 );
			base.AddElementFieldMapping( "SanPhamEntity", "MaChungLoaiSanPham", "MaChungLoaiSanPham", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 0 );
			base.AddElementFieldMapping( "SanPhamEntity", "MaSanPham", "MaSanPham", false, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 1 );
			base.AddElementFieldMapping( "SanPhamEntity", "TenSanPham", "TenSanPham", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 2 );
			base.AddElementFieldMapping( "SanPhamEntity", "Phot", "Phot", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 3 );
			base.AddElementFieldMapping( "SanPhamEntity", "De", "De", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 4 );
			base.AddElementFieldMapping( "SanPhamEntity", "CoSo", "CoSo", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 5 );
            base.AddElementFieldMapping( "SanPhamEntity", "Last", "Last", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 6);
			base.AddElementFieldMapping( "SanPhamEntity", "RapMai", "RapMai", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 7 );
			base.AddElementFieldMapping( "SanPhamEntity", "BanhMai", "BanhMai", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 8);
			base.AddElementFieldMapping( "SanPhamEntity", "Quai", "Quai", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 9 );
			base.AddElementFieldMapping( "SanPhamEntity", "KhuonMat", "KhuonMat", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 10 );
			base.AddElementFieldMapping( "SanPhamEntity", "GhiChu", "GhiChu", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 11 );
		}
		/// <summary>Inits SanPhamKhuonEntity's mappings</summary>
		private void InitSanPhamKhuonEntityMappings()
		{
			base.AddElementMapping( "SanPhamKhuonEntity", "TKCN", @"dbo", "SanPhamKhuon", 9 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "MaChungLoaiSanPham", "MaChungLoaiSanPham", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 0 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "MaSanPhamKhuon", "MaSanPhamKhuon", false, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 1 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "TenSanPhamKhuon", "TenSanPhamKhuon", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 2 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "LoaiSanPhamKhuon", "LoaiSanPhamKhuon", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 3 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "HinhSanPhamKhuon", "HinhSanPhamKhuon", true, (int)SqlDbType.Image, 2147483647, 0, 0, false, "", null, typeof(System.Byte[]), 4 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "DonViTinh", "DonViTinh", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 5 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "CoSo", "CoSo", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 6 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "SoLuong", "SoLuong", true, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 7 );
			base.AddElementFieldMapping( "SanPhamKhuonEntity", "GhiChu", "GhiChu", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 8 );
		}
        private void InitSanPhamClastEntityMappings()
        {
                base.AddElementMapping("SanPhamClastEntity", "TKCN", @"dbo", "SanPhamClast", 9);
                base.AddElementFieldMapping("SanPhamClastEntity", "MaChungLoaiSanPham", "MaChungLoaiSanPham", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 0);
                base.AddElementFieldMapping("SanPhamClastEntity", "MaSanPhamClast", "MaSanPhamClast", false, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 1);
                base.AddElementFieldMapping("SanPhamClastEntity", "TenSanPhamClast", "TenSanPhamClast", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 2);
                base.AddElementFieldMapping("SanPhamClastEntity", "LoaiSanPhamClast", "LoaiSanPhamClast", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 3);
                base.AddElementFieldMapping("SanPhamClastEntity", "HinhSanPhamClast", "HinhSanPhamClast", true, (int)SqlDbType.Image, 2147483647, 0, 0, false, "", null, typeof(System.Byte[]), 4);
                base.AddElementFieldMapping("SanPhamClastEntity", "DonViTinh", "DonViTinh", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 5);
                base.AddElementFieldMapping("SanPhamClastEntity", "CoSo", "CoSo", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 6);
                base.AddElementFieldMapping("SanPhamClastEntity", "SoLuong", "SoLuong", true, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 7);
                base.AddElementFieldMapping("SanPhamClastEntity", "GhiChu", "GhiChu", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 8);
        }

        private void InitSanPhamGotCheEntityMappings()
        {
            base.AddElementMapping("SanPhamGotCheEntity", "TKCN", @"dbo", "SanPhamGotChe", 9);
            base.AddElementFieldMapping("SanPhamGotCheEntity", "MaChungLoaiSanPham", "MaChungLoaiSanPham", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 0);
            base.AddElementFieldMapping("SanPhamGotCheEntity", "TenPhot", "TenPhot", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 1);
            base.AddElementFieldMapping("SanPhamGotCheEntity", "MaSanPham", "MaSanPham", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 2);
            base.AddElementFieldMapping("SanPhamGotCheEntity", "TenSanPham", "TenSanPham", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 3);
            base.AddElementFieldMapping("SanPhamGotCheEntity", "CSGotCheDoi", "CSGotCheDoi", true, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 4);
            base.AddElementFieldMapping("SanPhamGotCheEntity", "CSGotCheDon", "CSGotCheDon", true, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 5);
            base.AddElementFieldMapping("SanPhamGotCheEntity", "GhiChu", "GhiChu", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 6);
        }
        private void InitSanPhamBoEntityMappings()
        {
            base.AddElementMapping("SanPhamBoEntity", "TKCN", @"dbo", "SanPhamBo", 9);
            base.AddElementFieldMapping("SanPhamBoEntity", "MaChungLoaiSanPham", "MaChungLoaiSanPham", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 0);
            base.AddElementFieldMapping("SanPhamBoEntity", "MaChungLoaiBo", "MaChungLoaiBo", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 1);
            base.AddElementFieldMapping("SanPhamBoEntity", "TenChungLoaiBo", "TenChungLoaiBo", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 2);
            base.AddElementFieldMapping("SanPhamBoEntity", "BanCat", "BanCat", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 3);
            base.AddElementFieldMapping("SanPhamBoEntity", "BanThanhPham", "BanThanhPham", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 4);
            base.AddElementFieldMapping("SanPhamBoEntity", "MaSanPhamBo", "MaSanPhamBo", false, (int)SqlDbType.NVarChar, 20, 0, 0, false, "", null, typeof(System.String), 5);
            base.AddElementFieldMapping("SanPhamBoEntity", "HinhSanPhamBo", "HinhSanPhamBo", true, (int)SqlDbType.Image, 2147483647, 0, 0, false, "", null, typeof(System.Byte[]), 6);
            base.AddElementFieldMapping("SanPhamBoEntity", "SoLuong", "SoLuong", true, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 7);
            base.AddElementFieldMapping("SanPhamBoEntity", "VatTu", "VatTu", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 8);
            base.AddElementFieldMapping("SanPhamBoEntity", "GhiChu", "GhiChu", true, (int)SqlDbType.NVarChar, 200, 0, 0, false, "", null, typeof(System.String), 9);
        }
      
	}
}













